#!/usr/local/bin/lua
--
--	Chapter 03	-	Logic Operator
--
--	Michael Ge
--	2014.05.17
--

print("====================")

print(4 and 5)
print(nil and 3)
print(false and 13)
print(4 or 5)
print(false or 5)

print("====================")

x = nil
v = 5

if not x then
	x = v
end

print(x)

print("====================")

x = nil
v = 5

x = x or v

print(x)

print("====================")

x = 5
y = 6

max = (x > y) and x or y

print(max)

print("====================")

print(not nil)
print(not false)
print(not 0)
print(not not nil)

print("====================")